﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Webdiyer.WebControls.Mvc;

namespace Web.Controllers
{
    public class ShopController : Controller
    {
        private readonly Manager.BLL.Admin.M_ShopBll bll = new Manager.BLL.Admin.M_ShopBll();
        //
        // GET: /Shop/

        public ActionResult Home(int? id)
        {
            int shopid = id ?? 0;
            Manager.Model.Admin.M_Shop shop = bll.GetModel(shopid);
            if (shop != null)
                return View(shop);
            else
                return View();
        }

        public ActionResult StylistList(int? id,int? page)
        {
            int shopid = id ?? 0;
            Manager.Model.Admin.M_Shop shop = bll.GetModel(shopid);
            Manager.BLL.Admin.M_StylistBll bllStylist=new Manager.BLL.Admin.M_StylistBll();
            if (shop != null)
            {
                PagedList<Manager.Model.Admin.M_Stylist> lst=new PagedList<Manager.Model.Admin.M_Stylist>(bllStylist.GetModelList("IsValid=1 And StylistShopID="+shopid), page ?? 1, 10);
                ViewBag.StylistList = lst;
                return View(shop);
            }
            else
                return View();
        }
    }
}
